home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0"?>
-
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:fd="http://www.bradsoft.com/feeddemon/xmlns/1.0/">
- <xsl:output method="html"/>
-
- <!-- store count of items -->
- <xsl:variable name="item-count" select="count(newspaper/channel/item)"/>
-
- <xsl:variable name="common-styles">
- <style type="text/css">
- body {
- font: x-small "Trebuchet MS", Tahoma, sans-serif;
- color: black;
- margin: 0;
- padding: 0;
- background-color: #EAF4F4;
- filter: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#F7FCFC,endColorStr=#89B9BA);
- }
- span.nodescription { font-size: x-small; color: silver;}
- div.newspapertitle { font-weight: bold; font-size: 130%; text-align: center; margin: 10px 0; }
-
- div.newsitemcontent, div.newsitemfooter { padding: 10px 20px; }
- div.newsitemcontent a, div.newsitemfooter a { color: #336666; }
- div.newsitemcontent a:hover, div.newsitemfooter a:hover { color: #9966CC; }
- div.newsitemfooter { font-size: xx-small; text-align: right; font-style: italic }
- div.newsitemtitle { width: 100%; padding: 8px 20px; font-weight: bold; background-color: #6EB5B6; }
- div.newsitemtitle a { text-decoration: none; color: white; }
- div.newsitemtitle a:hover { text-decoration: underline;}
-
- div.newsitem {
- background-color: white;
- border: 1px solid #336666;
- border-right-width: 2px;
- border-bottom-width: 2px;
- overflow: auto;
- scrollbar-base-color: #BAD7D8;
- scrollbar-darkshadow-color: #EAF4F4;
- margin: 4px 6px;
- text-align: left;
- <xsl:choose>
- <xsl:when test="newspaper[@type='newsitem']">
- /* show single news item newspaper full page*/
- height: 98%;
- </xsl:when>
- <xsl:when test="$item-count = 1">
- /* same for channel and group newspapers with single item, but allow room for headline */
- height: 91%;
- </xsl:when>
- <xsl:when test="$item-count = 2">
- /* when only two items, show full page side-by-side */
- height: 90%;
- width: 45%;
- float: left;
- </xsl:when>
- <xsl:otherwise>
- /* otherwise show half page side-by-side */
- height: 44%;
- width: 45%;
- float: left;
- </xsl:otherwise>
- </xsl:choose>
- }
- </style>
- </xsl:variable>
-
- <xsl:template match="newspaper">
- <html>
- <head>
- <title>Newspaper</title>
- <xsl:copy-of select="$common-styles"/>
- </head>
- <body>
- <xsl:if test="title">
- <div class="newspapertitle">
- <xsl:value-of select="title" disable-output-escaping="yes"/>
- </div>
- </xsl:if>
- <xsl:for-each select="channel/item">
- <xsl:sort select="fd:sortKey" data-type="number" order="descending"/>
- <!-- <xsl:sort select="title"/> -->
- <xsl:apply-templates select="."/>
- </xsl:for-each>
- </body>
- </html>
- </xsl:template>
-
- <!-- news item template -->
- <xsl:template match="item">
- <div class="newsitem">
- <div class="newsitemtitle">
- <xsl:variable name="itemlink" select="link"/>
- <a href="{$itemlink}"><xsl:value-of select="title" disable-output-escaping="yes"/></a>
- </div>
- <div class="newsitemcontent">
- <xsl:value-of select="description" disable-output-escaping="yes"/>
- </div>
- <div class="newsitemfooter">
- <xsl:variable name="srclink" select="source/@htmlUrl"/>
- <xsl:value-of select="fd:dateDisplay"/> | <a href="{$srclink}"><xsl:value-of select="source"/></a>
- <!-- add link to comments if available -->
- <xsl:if test="comments">
- <xsl:variable name="commentlink" select="comments"/>
- <xsl:variable name="commentimg" select="'$IMAGEDIR$comments.gif'"/>
- | <a href="{$commentlink}"><img src="{$commentimg}" border="0" hspace="6"/></a>
- </xsl:if>
- <!-- add link to enclosure if available -->
- <xsl:if test="enclosure">
- <xsl:variable name="enclosurelink" select="enclosure/@url"/>
- <xsl:variable name="enclosureimg" select="'$IMAGEDIR$enclosure.gif'"/>
- | <a href="{$enclosurelink}"><img src="{$enclosureimg}" border="0" hspace="6"/></a>
- </xsl:if>
- </div>
- </div>
- </xsl:template>
-
- </xsl:stylesheet>